package com.ccb.sc.goods.controller;

import com.ccb.sc.common.bind.annotation.Limit;
import com.ccb.sc.common.bind.response.ResBody;
import com.ccb.sc.common.bind.vo.KeyValueIconVo;
import com.ccb.sc.common.modules.goods.service.IBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ken
 * @version 1.0
 * @date 2020-09-21
 */
@RestController
@Api(value = "品牌管理", tags = "品牌管理")
@RequestMapping("/app/brand")
public class AppBrandController {

    private IBrandService brandService;

    @Limit(period = 5, count = 5)
    @GetMapping("/list")
    @ApiOperation(value = "商品品牌列表", response = KeyValueIconVo.class, responseContainer = "list")
    public ResBody<?> list() {
        List<KeyValueIconVo> list = this.brandService.findAll();
        return ResBody.success(list);
    }

    @Autowired
    public void setBrandService(IBrandService brandService) {
        this.brandService = brandService;
    }
}
